﻿Public Class FrmChonNgayBaoCao

    Private _TuNgay As Date?
    Public Property TuNgay() As Date?
        Get
            Return _TuNgay
        End Get
        Set(ByVal value As Date?)
            _TuNgay = value
        End Set
    End Property

    Private _DenNgay As Date?
    Public Property DenNgay() As Date?
        Get
            Return _DenNgay
        End Get
        Set(ByVal value As Date?)
            _DenNgay = value
        End Set
    End Property

    Private Sub FrmChonNgayBaoCao_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Windows.Forms.Keys.Escape Then
            Me.Close()
        End If
    End Sub

    Private Sub FrmChonNgayBC_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        dteTuNgay.EditValue = DateSerial(vIntKTNam, vIntKTThang, 1)
        dteDenNgay.EditValue = DateSerial(vIntKTNam, vIntKTThang, Date.DaysInMonth(vIntKTNam, vIntKTThang))
        dteTuNgay.Focus()
    End Sub

    Private Sub btnChapNhan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChapNhan.Click
        btnChapNhan.Focus()
        TuNgay = CDate(dteTuNgay.EditValue)
        DenNgay = CDate(dteDenNgay.EditValue)
        Me.Close()
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        TuNgay = Nothing
        DenNgay = Nothing
        Me.Close()
    End Sub
End Class